diff options
Diffstat (limited to 'docs/[rfc5228] Sieve/obsolete/rfc3028 - sievescripts.txt')
-rwxr-xr-x | docs/[rfc5228] Sieve/obsolete/rfc3028 - sievescripts.txt | 276 |
1 files changed, 0 insertions, 276 deletions
diff --git a/docs/[rfc5228] Sieve/obsolete/rfc3028 - sievescripts.txt b/docs/[rfc5228] Sieve/obsolete/rfc3028 - sievescripts.txt deleted file mode 100755 index c5a57c46..00000000 --- a/docs/[rfc5228] Sieve/obsolete/rfc3028 - sievescripts.txt +++ /dev/null @@ -1,276 +0,0 @@ -This Sievecode is extracted from the sieve spec. - -_Comments_______________________________________________________________________ - -if size :over 100K { # this is a comment - discard; -} - ---- - -if size :over 100K { /* this is a comment - this is still a comment */ discard /* this is a comment - */ ; -} - -_Test Lists_____________________________________________________________________ - -if anyof (not exists ["From", "Date"], - header :contains "from" "fool@example.edu") { - discard; -} - -_Comparators____________________________________________________________________ - -if header :contains :comparator "i;octet" "Subject" - "MAKE MONEY FAST" { - discard; -} - -_Implicit Keep__________________________________________________________________ - -if size :over 500K { discard; } - -_Control Structure If´__________________________________________________________ - -require "fileinto"; -if header :contains "from" "coyote" { - discard; -} elsif header :contains ["subject"] ["$$$"] { - discard; -} else { - fileinto "INBOX"; -} - ---- - -if header :contains ["From"] ["coyote"] { - redirect "acm@example.edu"; -} elsif header :contains "Subject" "$$$" { - redirect "postmaster@example.edu"; -} else { - redirect "field@example.edu"; -} - -_Control Structure Require______________________________________________________ - -require ["fileinto", "reject"]; - ---- - -require "fileinto"; -require "vacation"; - -_Action reject__________________________________________________________________ - -if header :contains "from" "coyote@desert.example.org" { - reject "I am not taking mail from you, and I don't want - your birdseed, either!"; -} - -_Action fileinto________________________________________________________________ - -require "fileinto"; -if header :contains ["from"] "coyote" { - fileinto "INBOX.harassment"; -} - -_Action redirect________________________________________________________________ - -redirect "bart@example.edu"; - -_Action keep____________________________________________________________________ - -if size :under 1M { keep; } else { discard; } - --- - -if not size :under 1M { discard; } - -_Action discard_________________________________________________________________ - -if header :contains ["from"] ["idiot@example.edu"] { - discard; -} - -_Test Address___________________________________________________________________ - -if address :is :all "from" "tim@example.com" { - discard; -} - -_Envelope Test__________________________________________________________________ - -require "envelope"; -if envelope :all :is "from" "tim@example.com" { - discard; -} - -_Test exists____________________________________________________________________ - -if not exists ["From","Date"] { - discard; - } - -_Extended Example_______________________________________________________________ - -# -# Example Sieve Filter -# Declare any optional features or extension used by the script -# -require ["fileinto", "reject"]; - -# -# Reject any large messages (note that the four leading dots get -# "stuffed" to three) -# -if size :over 1M - { - reject text: -Please do not send me large attachments. -Put your file on a server and send me the URL. -Thank you. -.... Fred -. -; - stop; - } -# -# Handle messages from known mailing lists -# Move messages from IETF filter discussion list to filter folder -# -if header :is "Sender" "owner-ietf-mta-filters@imc.org" - { - fileinto "filter"; # move to "filter" folder - } -# -# Keep all messages to or from people in my company -# -elsif address :domain :is ["From", "To"] "example.com" - { - keep; # keep in "In" folder - } - -# -# Try and catch unsolicited email. If a message is not to me, -# or it contains a subject known to be spam, file it away. -# -elsif anyof (not address :all :contains - ["To", "Cc", "Bcc"] "me@example.com", - header :matches "subject" - ["*make*money*fast*", "*university*dipl*mas*"]) - { - # If message header does not contain my address, - # it's from a list. - fileinto "spam"; # move to "spam" folder - } -else - { - # Move all other (non-company) mail to "personal" - # folder. - fileinto "personal"; - } - - - -=IMAPFLAGS====================================================================== - -_Setflag Action_________________________________________________________________ - -if size :over 500K { - setflag "\\Deleted"; - } - ---- - -if header :contains "from" "boss@frobnitzm.edu" { - setflag "\\Flagged"; - fileinto "INBOX.From Boss"; -} - -_Addflag Action_________________________________________________________________ - -addflag "\\Deleted"; -addflag "\\Answered"; -addflag ["\\Deleted", "\\Answered"]; - -_Removeflag Action______________________________________________________________ - -if header :contains "Disposition-Notification-To" "mel@example.com" { - addflag "$MDNRequired"; -} -if header :contains "from" "imap@cac.washington.edu" { - removeflag "$MDNRequired"; - fileinto "INBOX.imap-list"; -} - -_Extended example_______________________________________________________________ - - # - # Example Sieve Filter - # Declare any optional features or extension used by the script - # - require ["fileinto", "reject", "imapflags"]; - - # - # Reject any large messages - # - if size :over 1M - { - if header :is "From" "boss@company.com" - { - addflag "\\Flagged $Big"; - # The message will be marked as "\Flagged $Big" when filed into - # mailbox "Big messages" - } - fileinto "Big messages"; - } - - if header :is "From" "grandma@example.net" - { - addflag ["\\Answered", "$MDNSent"]; - # If the message is bigger than 1Mb it will be marked as "\Flagged - # $Big \Answered $MDNSent" - # when filed into mailbox "grandma". If the message is shorter than - # 1Mb it will be marked as "\Answered $MDNSent" - fileinto "GrandMa"; # move to "GrandMa" folder - } - - # - # Handle messages from known mailing lists - # Move messages from IETF filter discussion list to filter folder - # - if header :is "Sender" "owner-ietf-mta-filters@imc.org" - { - setflag "\\Flagged"; - # Message will always have just "\Flagged" flag - keep; - } - - # - # Keep all messages to or from people in my company - # - elsif anyof address :domain :is ["From", "To"] "company.com" - { - keep; # keep in "In" folder - } - # - # Try and catch unsolicited email. If a message is not to me, - # or it contains a subject known to be spam, file it away. - # - elsif anyof (not address :all :contains - ["To", "Cc", "Bcc"] "me@company.com", - header :matches "subject" - ["*make*money*fast*", "*university*dipl*mas*"]) - { - removeflag "\\Flagged"; - # If message header does not contain my address, - # it's from a list. - fileinto "spam"; # move to "spam" folder - } - else - { - # Move all other (non-company) mail to "personal" - # folder. - fileinto "personal"; - } |